Submit Search
Upload
Brief introduction of Boost.ICL
•
0 likes
•
2 views
Y
yak1ex
Follow
Not yet presented anywhere.
Read less
Read more
Technology
Report
Share
Report
Share
1 of 15
Download now
Download to read offline
Recommended
第6回 配信講義 計算科学技術特論A(2021)
第6回 配信講義 計算科学技術特論A(2021)
RCCSRENKEI
第7回 配信講義 計算科学技術特論A(2021)
第7回 配信講義 計算科学技術特論A(2021)
RCCSRENKEI
Python physicalcomputing
Python physicalcomputing
Noboru Irieda
ATN No.2 Scala事始め
ATN No.2 Scala事始め
AdvancedTechNight
PHPでマルチスレッド
PHPでマルチスレッド
karky7
透過型確率的パケットマーキング装置の提案と開発(オープンルータコンペティション発表資料)
透過型確率的パケットマーキング装置の提案と開発(オープンルータコンペティション発表資料)
Akira Kanaoka
constexpr idioms
constexpr idioms
fimbul
Long Short-term Memory
Long Short-term Memory
nishio
Recommended
第6回 配信講義 計算科学技術特論A(2021)
第6回 配信講義 計算科学技術特論A(2021)
RCCSRENKEI
第7回 配信講義 計算科学技術特論A(2021)
第7回 配信講義 計算科学技術特論A(2021)
RCCSRENKEI
Python physicalcomputing
Python physicalcomputing
Noboru Irieda
ATN No.2 Scala事始め
ATN No.2 Scala事始め
AdvancedTechNight
PHPでマルチスレッド
PHPでマルチスレッド
karky7
透過型確率的パケットマーキング装置の提案と開発(オープンルータコンペティション発表資料)
透過型確率的パケットマーキング装置の提案と開発(オープンルータコンペティション発表資料)
Akira Kanaoka
constexpr idioms
constexpr idioms
fimbul
Long Short-term Memory
Long Short-term Memory
nishio
エキ Py 読書会02 2010/9/7
エキ Py 読書会02 2010/9/7
Tetsuya Morimoto
エキ Py 読書会02 2章後半
エキ Py 読書会02 2章後半
Tetsuya Morimoto
そしてjsの基礎へ戻る#4
そしてjsの基礎へ戻る#4
Shingo Inoue
Rcppのすすめ
Rcppのすすめ
Masaki Tsuda
R spec勉強会
R spec勉強会
Tatsunori Nishikori
Rの高速化
Rの高速化
弘毅 露崎
C++0x in programming competition
C++0x in programming competition
yak1ex
Introduction to programming competition [revised][PDF]
Introduction to programming competition [revised][PDF]
yak1ex
Introduction to programming competition [revised]
Introduction to programming competition [revised]
yak1ex
C++0x in programming competition
C++0x in programming competition
yak1ex
Introduction to programming competition
Introduction to programming competition
yak1ex
Impractical Introduction of Boost Spirit Qi [PPT]
Impractical Introduction of Boost Spirit Qi [PPT]
yak1ex
Brief introduction of Boost.ICL [PDF]
Brief introduction of Boost.ICL [PDF]
yak1ex
Brief introduction of Boost.ICL
Brief introduction of Boost.ICL
yak1ex
GC in C++0x [eng]
GC in C++0x [eng]
yak1ex
GC in C++0x
GC in C++0x
yak1ex
【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow
Sony - Neural Network Libraries
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
NTT DATA Technology & Innovation
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
keikoitakurag
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
atsushi061452
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
yassun7010
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
ssuserbefd24
More Related Content
Similar to Brief introduction of Boost.ICL
エキ Py 読書会02 2010/9/7
エキ Py 読書会02 2010/9/7
Tetsuya Morimoto
エキ Py 読書会02 2章後半
エキ Py 読書会02 2章後半
Tetsuya Morimoto
そしてjsの基礎へ戻る#4
そしてjsの基礎へ戻る#4
Shingo Inoue
Rcppのすすめ
Rcppのすすめ
Masaki Tsuda
R spec勉強会
R spec勉強会
Tatsunori Nishikori
Rの高速化
Rの高速化
弘毅 露崎
Similar to Brief introduction of Boost.ICL
(6)
エキ Py 読書会02 2010/9/7
エキ Py 読書会02 2010/9/7
エキ Py 読書会02 2章後半
エキ Py 読書会02 2章後半
そしてjsの基礎へ戻る#4
そしてjsの基礎へ戻る#4
Rcppのすすめ
Rcppのすすめ
R spec勉強会
R spec勉強会
Rの高速化
Rの高速化
More from yak1ex
C++0x in programming competition
C++0x in programming competition
yak1ex
Introduction to programming competition [revised][PDF]
Introduction to programming competition [revised][PDF]
yak1ex
Introduction to programming competition [revised]
Introduction to programming competition [revised]
yak1ex
C++0x in programming competition
C++0x in programming competition
yak1ex
Introduction to programming competition
Introduction to programming competition
yak1ex
Impractical Introduction of Boost Spirit Qi [PPT]
Impractical Introduction of Boost Spirit Qi [PPT]
yak1ex
Brief introduction of Boost.ICL [PDF]
Brief introduction of Boost.ICL [PDF]
yak1ex
Brief introduction of Boost.ICL
Brief introduction of Boost.ICL
yak1ex
GC in C++0x [eng]
GC in C++0x [eng]
yak1ex
GC in C++0x
GC in C++0x
yak1ex
More from yak1ex
(10)
C++0x in programming competition
C++0x in programming competition
Introduction to programming competition [revised][PDF]
Introduction to programming competition [revised][PDF]
Introduction to programming competition [revised]
Introduction to programming competition [revised]
C++0x in programming competition
C++0x in programming competition
Introduction to programming competition
Introduction to programming competition
Impractical Introduction of Boost Spirit Qi [PPT]
Impractical Introduction of Boost Spirit Qi [PPT]
Brief introduction of Boost.ICL [PDF]
Brief introduction of Boost.ICL [PDF]
Brief introduction of Boost.ICL
Brief introduction of Boost.ICL
GC in C++0x [eng]
GC in C++0x [eng]
GC in C++0x
GC in C++0x
Recently uploaded
【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow
Sony - Neural Network Libraries
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
NTT DATA Technology & Innovation
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
keikoitakurag
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
atsushi061452
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
yassun7010
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
ssuserbefd24
20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdf
Ayachika Kitazaki
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
CRI Japan, Inc.
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
iPride Co., Ltd.
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
atsushi061452
Recently uploaded
(10)
【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdf
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
Brief introduction of Boost.ICL
1.
紹介
詳解 ICL (Interval Container Library) 2011/2/26 Boost 勉強会 #4 未発表 @yak_ex / 新 康孝
2.
自己紹介 • 氏名: 新
康孝 (あたらし やすたか) • Twitter ID: yak_ex • Web: http://yak3.myhome.cx:8080/junks • C++ / Perl が主戦場 • 現在、仕事でコードに触れていないので 競技プログラミング(TopCoder、Codeforces)で 潤い補充 • 闇の軍団に憧れるただの C++ 好き – 今回は ICL のさわりだけ、というかさわりしか分からない
3.
ぼくのかんがえた「ぶーすと」のぶんるい
アプリより 小規模 大規模 実装より
4.
ぼくのかんがえた「ぶーすと」のぶんるい
アプリより ~1.25 test graph progress_display た んはココ thread 小規模 大規模 crc pool regex tokenizer lexical_cast random function array timer rational iteratorstype_traits any operators tuple 実装より
5.
ぼくのかんがえた「ぶーすと」のぶんるい
異次元 アプリより ~1.30 preprocessor test spirit date_time graph filesystem progress_display た んはココ thread 小規模 format 大規模 crc pool regex tokenizer lexical_cast random function array lambda timer rational multi_array iteratorstype_traits any optional mpl tuple 実装より
6.
ぼくのかんがえた「ぶーすと」のぶんるい
異次元 アプリより ~1.35 preprocessor test asio wave gil spirit date_time graph filesystem progress_display た statechart thread んはココ serialization 小規模 format program_options interprocess 大規模 crc pool regex tokenizer xpressive lexical_cast random bimap function multi_index array parameter lambda intrusive variant ptr_container range fusion timer rational foreach multi_array iteratorstype_traits any optional typeof mpl tuple 実装より
7.
ぼくのかんがえた「ぶーすと」のぶんるい
異次元 アプリより ~1.40 preprocessor test asio wave accmulators gil spirit date_time graph filesystem progress_display た statechart thread んはココ serialization 小規模 format program_options proto interprocess 大規模 crc pool regex tokenizer xpressive lexical_cast random scope_exit bimap function unordered multi_index array parameter lambda flyweight intrusive variant ptr_container range fusion timer rational foreach multi_array iteratorstype_traits any optional typeof mpl tuple 実装より
8.
ぼくのかんがえた「ぶーすと」のぶんるい
異次元 アプリより ~1.45 preprocessor test asio wave accmulators gil spirit date_time graph filesystem property_tree polygon progress_display た msm statechart thread んはココ serialization 小規模 uuid format program_options proto interprocess 大規模 crc pool regex tokenizer xpressive lexical_cast random scope_exit bimap function unordered multi_index array parameter lambda flyweight intrusive variant ptr_container range fusion timer rational foreach multi_array iteratorstype_traits any optional typeof mpl tuple 実装より
9.
ぼくのかんがえた「ぶーすと」のぶんるい
異次元 アプリより ~1.46 preprocessor test asio wave accmulators gil spirit date_time graph filesystem property_tree ICL polygon progress_display た msm statechart thread んはココ serialization 小規模 uuid format program_options proto interprocess 大規模 crc pool regex tokenizer xpressive lexical_cast random scope_exit bimap function unordered multi_index array parameter lambda flyweight intrusive variant ptr_container range fusion timer rational foreach multi_array iteratorstype_traits any optional typeof mpl tuple 実装より
10.
ここで競技コーディングのお時間です • akira さん(仮名)はパーティーを開くことになりました。N
人 のお客さんが参加する予定ですが参加時間帯[si, ti)が皆ば らばらです。場所の予約のために参加人数の最も多い時間 帯を知りたいのでプログラムを作って akira さんを助けてあ げましょう。 – 1 ≦ N ≦ 1000 – -109 ≦ si < ti ≦ 109, si, ti は整数 (i=1,2,…,N) – 参加人数が同じ時間帯が隣接している場合、参加者が異なっていて も一つの時間帯と見なす – 同一参加人数の時間帯が複数ある場合は最長の時間帯を、同じ長 さの時間帯が複数ある場合は開始時刻がもっとも早い時間帯を返す – 入力: N<改行>s1<空白>t1<改行>…sN<空白>tN<改行> – 出力:開始時刻<空白>終了時刻<空白>人数<改行>
11.
解答例全文 using ICL #include
<iostream> #include <algorithm> #include <utility> #include 含めて 25 行 #include <boost/icl/interval_map.hpp> int main(void) { boost::icl::interval_map<int, int> sum; int n; std::cin >> n; for(int i = 0; i < n; ++i) { int s, t; std::cin >> s >> t; sum += std::make_pair(boost::icl::interval<int>::right_open(s, t), 1); } typedef boost::icl::interval_map<int, int>::value_type value_type; auto it = max_element(sum.begin(), sum.end(), [](const value_type &v1, const value_type &v2) { return v1.second < v2.second || (v1.second == v2.second && v1.first.upper() - v1.first.lower() < v2.first.upper() - v2.first.lower()) || (v1.second == v2.second && v1.first.upper() - v1.first.lower() == v2.first.upper() - v2.first.lower() && v1.first.lower() < v2.first.lower()); }); std::cout << it->first.lower() << ' ' << it->first.upper() << ' ' << it->second << std::endl; return 0; }
12.
解答例全文 using ICL #include
<iostream> #include <algorithm> ヘッダのインクルード #include <utility> #include <boost/icl/interval_map.hpp> int main(void) { boost::icl::interval_map<int, int> sum; int n; std::cin >> n; for(int i = 0; i < n; ++i) { int s, t; 入力と登録 std::cin >> s >> t; sum += std::make_pair(boost::icl::interval<int>::right_open(s, t), 1); } typedef boost::icl::interval_map<int, int>::value_type value_type; 最大値取得 auto it = max_element(sum.begin(), sum.end(), [](const value_type &v1, const value_type &v2) { return v1.second < v2.second || (v1.second == v2.second && v1.first.upper() - v1.first.lower() < v2.first.upper() - v2.first.lower()) || (v1.second == v2.second && v1.first.upper() - v1.first.lower() == v2.first.upper() - v2.first.lower() && v1.first.lower() < v2.first.lower()); }); std::cout << it->first.lower() << ' ' << it->first.upper() << ' ' << it->second << std::endl; return 0; 出力 }
13.
解答例 入力と登録 boost::icl::interval_map<int, int>
sum; int n; std::cin >> n; for(int i = 0; i < n; ++i) { 今回は数だが集合も可能 int s, t; std::cin >> s >> t; 右開区間 [s, t) sum += std::make_pair(boost::icl::interval<int>::right_open(s, t), 1); } 1 1 + + 1 1 split_interval_map interval_map 1 2 1 1 1 1
14.
解答例 最大値取得 typedef boost::icl::interval_map<int,
int>::value_type value_type; auto it = max_element(sum.begin(), sum.end(), [](const value_type &v1, const value_type &v2) { return v1.second < v2.second || // 集計値は second (v1.second == v2.second && // 区間は first (upper(), lower() で境界値) v1.first.upper() - v1.first.lower() < v2.first.upper() - v2.first.lower()) || (v1.second == v2.second && v1.first.upper() - v1.first.lower() == v2.first.upper() - v2.first.lower() && v1.first.lower() < v2.first.lower()); }); 集計された区間の結果を iteration 可能なので普通に max_element で最大値取得
15.
Interval Container Library •
1.46 で導入 • 開区間、閉区間等全部取り扱い可能 • 区間に対する集合演算、「集計」が可能 • interval_set, interval_map interval_set a interval_set b interval_set a - b • 区間の統合方法として join, separate, split を選択可能 • ストリーム出力有り(例:{(1,3][4.6](7,8]}) • Traits 用意すれば自前の interval を突っ込むことも可能 • 数値に限定されないので例えば cotinuous_interval<std::string> w(“a”, “c”) // right_open とか書くと a, b で始まる文字列全部を表すことになる。 • Example がいっぱいなのでそれ見ればOK
Download now